/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myapp.c0910g.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author BachLe
 */
@Entity
@Table(name = "ShipType")
@NamedQueries({
    @NamedQuery(name = "ShipType.findAll", query = "SELECT s FROM ShipType s"),
    @NamedQuery(name = "ShipType.findByShipTypeID", query = "SELECT s FROM ShipType s WHERE s.shipTypeID = :shipTypeID"),
    @NamedQuery(name = "ShipType.findByShipTypeName", query = "SELECT s FROM ShipType s WHERE s.shipTypeName = :shipTypeName")})
public class ShipType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "ShipTypeID")
    private Integer shipTypeID;
    @Basic(optional = false)
    @Column(name = "ShipTypeName")
    private String shipTypeName;
    @OneToMany(mappedBy = "shipType")
    private List<UserRadioCab> userRadioCabList;

    public ShipType() {
    }

    public ShipType(Integer shipTypeID) {
        this.shipTypeID = shipTypeID;
    }

    public ShipType(Integer shipTypeID, String shipTypeName) {
        this.shipTypeID = shipTypeID;
        this.shipTypeName = shipTypeName;
    }

    public Integer getShipTypeID() {
        return shipTypeID;
    }

    public void setShipTypeID(Integer shipTypeID) {
        this.shipTypeID = shipTypeID;
    }

    public String getShipTypeName() {
        return shipTypeName;
    }

    public void setShipTypeName(String shipTypeName) {
        this.shipTypeName = shipTypeName;
    }

    public List<UserRadioCab> getUserRadioCabList() {
        return userRadioCabList;
    }

    public void setUserRadioCabList(List<UserRadioCab> userRadioCabList) {
        this.userRadioCabList = userRadioCabList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shipTypeID != null ? shipTypeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShipType)) {
            return false;
        }
        ShipType other = (ShipType) object;
        if ((this.shipTypeID == null && other.shipTypeID != null) || (this.shipTypeID != null && !this.shipTypeID.equals(other.shipTypeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.myapp.c0910g.entity.ShipType[shipTypeID=" + shipTypeID + "]";
    }

}
